import React from 'react';
import { Layout, Menu, Breadcrumb, Icon } from 'antd';

import Students from '../students';
import Classes from '../classes';
import Teachers from '../teachers';

import {Route,Link} from 'react-router-dom';
import './index.css';
const { SubMenu } = Menu;
const { Header, Content, Sider } = Layout;

export default class Manage extends React.Component {
    constructor() {
        super();
       
    }
    componentWillMount(){
        console.log(this.props.location.pathname);
        
    }
   
    render() {
        return (
            <Layout style={{height:"100%"}}>
                <Header className="header">
                    <div className="logo" />

                </Header>
                <Layout>
                    <Sider width={200} style={{ background: '#fff' }}>
                        <Menu
                            mode="inline"
                            defaultSelectedKeys={[this.props.location.pathname]}
                            theme="dark"
                            style={{ height: '100%', borderRight: 0 }}
                        >
                            <Menu.Item key="/manage/students"><Link to="/manage/students">学生管理</Link></Menu.Item>
                            <Menu.Item key="/manage/classes"><Link to="/manage/classes">班级管理</Link></Menu.Item>
                            <Menu.Item key="/manage/teachers"><Link to="/manage/teachers">老师管理</Link></Menu.Item>

                        </Menu>
                    </Sider>
                    <Layout style={{ padding: '0 24px 24px' }}>
                        
                        <Content style={{ background: '#fff', padding: 24, margin: 0, minHeight: 280 }}>
                            <Route path="/manage/students" component={Students}></Route>
                            <Route path="/manage/classes" component={Classes}></Route>
                            <Route path="/manage/teachers" component={Teachers}></Route>
        </Content>
                    </Layout>
                </Layout>
            </Layout>
        )
    }
}